<?php
/**
 * Created by PhpStorm.
 * User: zing
 * Date: 2018/5/3
 * Time: 15:01
 */

//0
echo count([]) . PHP_EOL;

//1
echo count([[]]) . PHP_EOL;

//1
echo count(['']) . PHP_EOL;


$arr = [2 => 100, 1 => 200, 5 => 222];
print_r($arr);

//重建索引
print_r(array_merge($arr));

$buy_ticket = [
    ['supplier_ticket_id' => 1, 'biz_ticket_id' => 25694, 'buy_num' => 10, 'type' => 1, 'ticket_sale_price' => 100],
    ['supplier_ticket_id' => 2, 'biz_ticket_id' => 25694, 'buy_num' => 12, 'type' => 1, 'ticket_sale_price' => 50],
    ['supplier_ticket_id' => 173, 'biz_ticket_id' => 173, 'buy_num' => 12, 'type' => 1, 'ticket_sale_price' => 50],
    ['supplier_ticket_id' => 189, 'biz_ticket_id' => 189, 'buy_num' => 12, 'type' => 1, 'ticket_sale_price' => 50],
];


$column = array_column($buy_ticket,'supplier_ticket_id');
print_r($column);

$search = array_search(173,$column);
print_r($search);
print_r($buy_ticket[$search]);

$str = '["173","189","190","191","192"]';
print_r(json_decode($str),true);
print_r(json_decode($str),false);